package com.gxwz.document.business.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gxwz.document.business.dao.IrecyclebinDao;
import com.gxwz.document.business.entity.Recyclebin;
import com.gxwz.document.business.service.IrecyclebinService;
import com.gxwz.document.business.service.IuserService;

@SuppressWarnings("unused")
@Service("recyclebinService")
public class RecyclebinServiceImpl implements IrecyclebinService{
	@Resource(name = "recyclebinDao")
	private IrecyclebinDao rbDao;

	@Override
	public List<Recyclebin> findAll() {
		String hql ="from Recyclebin";
		return rbDao.find(hql);
	}
	public List<Recyclebin> findByPage(int index, int pageSize){
		String hql = "from Recyclebin";
		return rbDao.findByPage(hql, index, pageSize);
	}
	
	
	@Override
	public void delete(int rbId){
		rbDao.delete(rbDao.findById(Recyclebin.class, rbId));	
	}

	@Override
	public Recyclebin findRecId(int rbId) {
		return rbDao.findById(Recyclebin.class, rbId);
	}


	@Override
	public int getRowNum() {
		
		return rbDao.findAll().size();
	}


}
